home *** CD-ROM | disk | FTP | other *** search
-
-
-
- MAKE ST-UNIX User's Manual MAKE
-
-
-
- COMMAND
- make - rule based file maintainer.
-
- FORMAT
- make [ -f makefile ] [ option ] ... name ...
-
- DESCRIPTION
- _✓M_✓a_✓k_✓e executes commands in _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e to update one or more
- target _✓n_✓a_✓m_✓e_✓s. If no -f option is present, `makefile' and
- `Makefile' are tried in order. If _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e is `-', the
- standard input is taken. More than one -f option may appear
-
- _✓M_✓a_✓k_✓e parses the file to produce a list of pre-requisites
- specified for each target. The target is updated if any of
- its pre-requisites have changed since it was last modified.
-
- _✓M_✓a_✓k_✓e_✓f_✓i_✓l_✓e contains a sequence of entries that specify depen-
- dencies. The first line of an entry is a blank-separated
- list of targets, then a colon, then a list of prerequisite
- files. Text following a semicolon, and all following lines
- that begin with a tab, are shell commands to be executed to
- update the target.
-
- All text from a '#' to the end of the line is treated as a
- comment and ignored. _✓M_✓a_✓k_✓e_✓f_✓i_✓l_✓e entries of the form
-
- string1 = string2
-
- are variable assigments. Variables are invoked by
- $(_✓s_✓t_✓r_✓i_✓n_✓g_✓1) or ${_✓s_✓t_✓r_✓i_✓n_✓g_✓1} and cause _✓s_✓t_✓r_✓i_✓n_✓g_✓2 to be inserted.
- Parentheses are not needed if _✓s_✓t_✓r_✓i_✓n_✓g_✓1 is a single character.
-
- _✓M_✓a_✓k_✓e infers prerequisites for files for which _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e gives
- no construction commands. The default prerequisites are set
- up to be used with the lattice C compiler and linker however
- they may be easily redefined by the user to work with what-
- ever compiler is in use. An example of the inferences made;
- a `.c' file may be inferred as prerequisite for a `.bin'
- file and be compiled to produce the `.bin' file. Thus the
- following example shows that prog.prg depends on prog.bin
- which depends on prog.c which in turn depends on all.h:
-
- prog.prg: prog.bin
- c.lnk prog.bin -WITH C -PROG prog.bin
- prog.bin: prog.c
- lc prog.c
- prog.c: all.h
- Now using the default pre-requisites we can re-write this
- as:
-
- prog.c: all.h
-
-
-
-
- Printed 28/March/1988 30 March 1987 1
-
-
-
-
-
-
- MAKE ST-UNIX User's Manual MAKE
-
-
-
- and all the other dependencies will be inferred.
-
- Prerequisites are inferred according to selected suffixes
- listed as the `prerequisites' for the special name `.SUF-
- FIXES'; multiple lists accumulate; an empty list clears what
- came before. Order is significant; the first possible name
- for which both a file and a rule as described in the next
- paragraph exist is inferred. The default list is
-
- .SUFFIXES: .tos .ttp .prg .bin .c
-
- The suffixes used will depend upon the compiler you are
- using, thus lattice C will generate `.bin' files whereas
- magamax will generate `.o' files. The default actions for
- make are to use the lattice compiler `lc' to compile with
- and the lattice linker `c.lnk' to link with.
-
- To overide these defaults the CC variable (initially set to
- `lc') may be set to the compiler you are using, with the
- CFLAGS variable (initially not used) choosing any options to
- the compiler. The LD variable (initially `c.lnk') controls
- linking in a similar manner with the LDFLAGS variable (ini-
- tially `-WITH C -NOLIST') which can again be overridden by
- the user.
-
- The rule to create a file with suffix _✓s_✓2 that depends on a
- similarly named file with suffix _✓s_✓1 is specified as an entry
- for the `target' _✓s_✓1_✓s_✓2.
-
- The special macro $* stands for the target name with suffix
- deleted, $@ for the full target name, $< for the complete
- list of prerequisites, and $? for the list of prerequisites
- that are out of date. For example, a rule for making `.bin'
- files from `.c' files is
-
- .c.bin: ; $(CC) $(CFLAGS) $*.c
-
- The Variable `CFLAGS' is used to send arguments to the C
- compiler, and `MFLAGS' contains the command line options
- supplied to _✓m_✓a_✓k_✓e.
-
- Similarly the rule to make `.tos' files from `.bin' file is:
-
- .bin.tos: ; $(LD) $*.bin $(LDFLAGS) -PROG $@
-
- A line is printed when it is executed unless the special
- target `.SILENT' is in _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e, or the first character of
- the command is `@'.
-
- Commands returning nonzero status cause _✓m_✓a_✓k_✓e to terminate
- unless the special target `.IGNORE' is in _✓m_✓a_✓k_✓e_✓f_✓i_✓l_✓e or the
- command begins with <tab><hyphen>.
-
-
-
- Printed 28/March/1988 30 March 1987 2
-
-
-
-
-
-
- MAKE ST-UNIX User's Manual MAKE
-
-
-
- Other options:
-
- -i Equivalent to the special entry `.IGNORE:'.
-
- -k When a command returns nonzero status, abandon work on
- the current entry, but continue on branches that do not
- depend on the current entry.
-
- -n Trace and print, but do not execute the commands needed
- to update the targets.
-
- -t Touch, i.e. update the modified date of targets,
- without executing any commands.
-
- -r Equivalent to an initial special entry `.SUFFIXES:'
- with no list.
-
- -s Equivalent to the special entry `.SILENT:'.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Printed 28/March/1988 30 March 1987 3
-
-
-
-